/**
 * Created by jihb on 4/30/16.
 */
Ext.define('JYnovel.view.novel.NovelCategoryView',{
    extend:'Ext.container.Viewport',
    layout:'fit',
    initComponent:function () {
        Ext.applyIf(this,{
            items:[{
                xtype:'NovelCategoryTreePanel'
            }]
        });
        this.callParent(arguments)
    }
});
Ext.define('JYnovel.view.novel.NovelCategoryTreePanel',{
    extend:'Ext.tree.Panel',
    alias:'widget.NovelCategoryTreePanel',
    store: 'novel.NovelCategoryTreeStore',
    rootVisible: false,
    autoScroll:true,
    emptyText:'无数据',
    collapsed: false,
    border:false,
    minHeight:100,
    singleExpand: true,
    useArrows: true,
    initComponent:function(){
        var me = this;
        Ext.applyIf(me,{
            columns:[
                {
                    xtype: 'treecolumn',
                    text:'分类名',
                    dataIndex:'name',
                    sortable:false,
                    flex:1
                }
            ],
            dockedItems: [
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
                        {
                            xtype: 'button',
                            name:'novelCategoryAddBtn',
                            text: '添加',
                            icon: ctx+'/images/icon/add.png'
                        }
                    ]
                }
            ]
        });
        me.callParent(arguments);
    }
});

/**
 * 分类树右键菜单
 */
Ext.define('JYnovel.view.novel.NovelCategoryTreeGridRightMenu',{
    extend:'Ext.menu.Menu',
    alias:'widget.NovelCategoryTreeGridRightMenu',
    width:120,
    requires: [
        'Ext.menu.Item'
    ],
    initComponent:function () {
        Ext.applyIf(this,{
            items:[{
                name:'novelSubCategoryAddBtn',
                text: '添加',
                icon: ctx+'/images/icon/add.png'
            },{
                name:'novelSubCategoryEditBtn',
                text: '编辑',
                icon: ctx+'/images/icon/table_edit.png'
            },{
                name:'novelSubCategoryDeleteBtn',
                icon: ctx+'/images/icon/table_delete.png',
                text: '删除'
            }]
        });
        this.callParent(arguments);
    }
});